<?php
/* @var $this HelpController */
/* @var $model Help */
/* @var $form CActiveForm */


?>
<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'help-form',
	//'enableAjaxValidation'=>true,
	'enableClientValidation'=>true
)); ?>
	<ul class="form_list form_list2 mt10">
		<li class="c_f"><span class="tit"><em class="xing">*</em>选择类目：</span>
			<div class="cont f_l" id="catagory">
				<select name="cateid1" class="level_1 s_ipt w_120" id="dataProductIndustryId1" ></select>
				<select name="cateid2" class="level_2 s_ipt w_120  id="dataProductIndustryId2"></select>
				<?php echo $form->error($model,'zhc_id'); ?>
			</div>
		</li>
		<li class="c_f"><span class="tit"><em class="xing">*</em>标题：</span>
			<div class="cont f_l">
			<?php echo $form->textField($model,'zhe_title',array('class'=>"t_ipt w_300",'maxlength'=>30)); ?>
			<?php echo $form->error($model,'zhe_title'); ?>
			</div>
		</li>
		<li class="c_f"><span class="tit"><em class="xing">*</em>信息内容：</span>
			<div class="cont f_l">
				<?php  $this->widget('ext.keditor.KEditor',array(
		            'model'=>$model,  //传入form model
		            'name'=>'zhe_content', //设置name
		            'properties'=>array(
		                //设置接收文件上传的action
		                'uploadJson'=>'/Attachment/GetAjax',
		                //设置浏览服务器文件的action，这两个就是上面配置在/admin/default的
		             //   'fileManagerJson'=>'/Attachment/GetAjax',
		                'newlineTag'=>'br',
		                'allowFileManager'=>true,
		                //传值前加js:来标记这些是js代码
		                'afterCreate'=>"js:function() {
		                        K('#ChapterForm_all_len').val(this.count());
		                        K('#ChapterForm_word_len').val(this.count('text'));
		                    }",
		                'afterChange'=>"js:function() {
		                        K('#ChapterForm_all_len').val(this.count());
		                        K('#ChapterForm_word_len').val(this.count('text'));
		                    }",
		            ),
		            'textareaOptions'=>array(
		                'style'=>'width:700px;height:361px;',
		            )
		        )); ?>
				<p class="c_999">上传图片规格：宽度不能超过750px</p>
			</div>
		</li>
		<li class="c_f"><span class="tit">是否推荐：</span>
			<div class="cont f_l">
				<?php echo $form->radioButtonList($model,'zhe_highlight',Help::model()->getZheHighlight(),array('class'=>'radio','labelOptions'=>array('class'=>'mr20')))?>
			</div>
		</li>
		<li class="c_f"><span class="tit">&nbsp;</span>
			<div class="cont f_l">
				<?php echo CHtml::submitButton(Yii::t('adm','Save Data'),array('class'=>'mem_btn mem_btn20 mr5'))?>
				<?php echo CHtml::resetButton(Yii::t('adm','Reset'),array('class'=>'mem_btn mem_btn07'))?>
			</div>
		</li>
	</ul>	

<?php $this->endWidget(); ?>

<script type="text/javascript" src="/js/multi_select.js"></script>
<script type="text/javascript">
$.getJSON('/cache/getHelpCat',function(json){
	var options	= {data	: json};
	var loc = new multi_select(options);
	loc.bind('#catagory .level_1','<?php if(!empty($model->helpcat)) echo ($model->helpcat->zhc_parentid==0)?$model->helpcat->zhc_id:(($model->helpcat->zhc_topid==0)?$model->helpcat->zhc_parentid:$model->helpcat->zhc_topid)?>');
	loc.bind('#catagory .level_2','<?php if(!empty($model->helpcat)) echo ($model->helpcat->zhc_parentid==0)?'':(($model->helpcat->zhc_topid==0)?$model->helpcat->zhc_id:$model->helpcat->zhc_parentid)?>');
});
</script>